﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<div id="carstate">
    <div style=" padding-top:35px;">
        车辆名称<%=Html.DropDownList("query_carid", ViewData["list_car"] as List<SelectListItem>, "---------请选择---------", new { @style = "width:202px; margin-left:8px; padding:0px;border-radius:0px 0px 0px 0px;border:solid 1px #6C92AD;" })%>
        <input id="query_time" class="Wdate" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" />
        <input type="button" value="查询" onclick="DoCarStateQuery()" />
    </div>
    <div id="carstate_content" style="padding-left: 50px; padding-top: 50px;">
    </div>
</div>

<script type="text/javascript">
    function DoCarStateQuery() {
        var query_carid = $("#carstate #query_carid").val();
        if (query_carid == null || query_carid == "") {
            alert("请选择车辆！");
            return;
        }
        var query_time = $("#carstate #query_time").val();
        if (query_time == null || query_time == "") {
            alert("请选择时间！");
            return;
        }
        $.ajax({
            type: "POST",
            url: "/Car/DoCarStateQuery",
            data: { "query_carid": query_carid, "query_time": query_time },
            success: function(data) {
                //alert(JSON.stringify(data));
                var setting = {};
                setting.data = data;
                setting.id = "carstate_content";
                $.fn.carstate(setting);
            }
        })
    }
</script>

